<?php

	abstract class Controller_Base
	{
		protected $registry;
		protected $webPage;
		
		function __construct($registry)
		{
			$this->registry = $registry;
			$this->webPage = new WebPage($registry->get('theme'));
		}
		abstract function index();
		
		public function beginAction($action, $folder)
		{
			$this->beforeAction();
			$this->$action();
			$this->afterAction($folder.DIRSEP.$action.'.tpl');
		}
		
		protected function beforeAction()
		{
		}
		protected function afterAction($template)
		{
			$this->webPage->display($template);
		}
		protected function assignData($key, $value)
		{
			$this->webPage->assign($key, $value);
		}
	}


?>